include( 'shared.lua' ) //LOAD THAT
include('scoreboard/scoreboard.lua')

//----------------SpawnMenu-------------------------------
include("Spawn_menus/cl_Spawnderma.lua")
//--------------------------------------------------


//---------------------------------
function set_team() //Function for the window when joining as neither special character nor Admin
 
Ready = vgui.Create( "DFrame" ) //Define ready as a "DFrame"
Ready:SetPos( ScrW() / 2, ScrH() / 2 ) //Set the position. Half the screen height and half the screen width. This will result in being bottom right of the middle of the screen.
Ready:SetSize( 175, 75 ) //The size, in pixels of the Frame
Ready:SetTitle( "Are you ready to build?" ) //The title; It's at the top.
Ready:SetVisible( true ) // Should it be seen? 
Ready:SetDraggable( false ) // Can people drag it around?
Ready:ShowCloseButton( true ) //Show the little X top right? I chose no, because I have no alternative, meaning people would roam around with no weapons
Ready:MakePopup() //Make it popup. Of course.
ready1 = vgui.Create( "DButton", Ready ) // Define ready1 as a "DButton" with its parent the Ready frame we just created above.
ready1:SetPos( 20, 30 ) //Set position, relative to the frame (If you didn't parent it, it would be relative to the screen
ready1:SetSize( 60, 40 ) // How big it should be, again in pixels
ready1:SetText( "Red Team" ) //What should the button say? 
ready2 = vgui.Create( "DButton", Ready ) // Define ready1 as a "DButton" with its parent the Ready frame we just created above.
ready2:SetPos( 95, 30 ) //Set position, relative to the frame (If you didn't parent it, it would be relative to the screen
ready2:SetSize( 60, 40 ) // How big it should be, again in pixels
ready2:SetText( "Blue Team" ) //What should the button say? 
ready1.DoClick = function() //ready1.doclick = function, we just defined it as a function
RunConsoleCommand( "sb_team2" ) //When it clicks, which function does it run? sb_team1, which is defined in init.lua
Ready:Close()
end
ready2.DoClick = function() //ready2.doclick = function, we just defined it as a function
RunConsoleCommand( "sb_team1" ) //When it clicks, which function does it run? sb_team1, which is defined in init.lua
Ready:Close()
end // end the doclick function
end // end the set_team function
concommand.Add( "sb_start", set_team )
function hud()
	local client = LocalPlayer()
	if !client:Alive() then return end
	draw.RoundedBox(0, 85, 45, 110, 42, Color(51, 58, 51, 50))
	draw.SimpleText("Red Team:  " .. team.GetScore(2), "ScoreboardText", 100, 50, Color(255, 80, 80, 255), 0, 0)
	draw.SimpleText("Blue Team: " .. team.GetScore(1), "ScoreboardText", 100, 65, Color(80, 150, 255, 255), 0, 0)
end
hook.Add("HUDPaint", "hud", hud)